{extend name="public/layout"/}
{block name="main"}
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class="layui-this">{:lang('published')}</li>
    </ul>
    <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
        	<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
        </div>
    </div>
</div>
<script type="text/html" id="barTool">
    <a href='{:url("edit")}?id={{ d.id }}&did={{ d.content_id }}' class="layui-btn layui-btn-xs">{:lang('Edit')}</a>
    <a href='{:url("del")}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">{:lang('delete')}</a>
</script>
<script type="text/html" id="status">
    {{#  if(d.status==-1){ }}
<button class="layui-btn layui-btn-danger layui-btn layui-btn-xs">{:lang('Rejected')}</button>
    {{#  } else if(d.status==0){ }}
<button class="layui-btn layui-btn-danger layui-btn layui-btn-xs">{:lang('NotApproved')}</button>
    {{#  } else if(d.status==1){ }}
<button class="layui-btn layui-btn layui-btn-xs">{:lang('Passed')}</button>
    {{#  } }}
</script>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <a class="layui-btn layui-btn-sm layui-btn-normal" href="{:url('member/content/publish')}"><i class="layui-icon">&#xe61f;</i> {:lang('publish')}</a>
    </div>
</script>
{/block}
{block name="js"}
<script>
layui.use(['table'], function() {
    var table = layui.table,
        $ = layui.$,
        form = layui.form;
    table.render({
        elem: '#dataTable',
        toolbar: '#toolbarDemo',
        url: '{:url("published")}',
        cols: [
            [
                { field: 'id', width: 60, title: 'ID' },
                { field: 'theme', title: "{:lang('theme')}"},
                { field: 'catname',width: 120, title: "{:lang('catname')}"},
                { field: 'create_time', width: 180, title: "{:lang('inputTime')}" },
                { field: 'url',width: 60,align:"center", title: 'URL',templet:'<div><a href="{{ d.url }}" target="_blank"><i class="iconfont icon-lianjie"></i></a></div>'},
                { field: 'status', width: 80, title: "{:lang('status')}",align: "center", templet: '#status' },
                { fixed: 'right', width: 120, title: "{:lang('operation')}", toolbar: '#barTool' }
            ]
        ],
        page: {}
    });

});
</script>
{/block}